﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/AdminMaster.Master" AutoEventWireup="true" CodeBehind="Location.aspx.cs" Inherits="MonitorPlan.Admin.Config" %>
<%@ MasterType VirtualPath="~/Admin/AdminMaster.Master" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>Location Management</title>
    <script>
        $(document).ready(function () {
            $("a#btnLocation").css("background", "#CCC");
        });
    </script>
    <style>

    </style>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
             <asp:SqlDataSource ID="s1" runat="server" ConnectionString="<%$ ConnectionStrings:conStr %>"
             SelectCommand="select * from location where isdeleted=0"></asp:SqlDataSource>
             <ul class="nav nav-pills action-buttons">
                <li><asp:LinkButton ID="btnView" runat="server" OnClick="btnView_Click">
                    <i class="icon icon-view"></i>&nbsp;View</asp:LinkButton></li>
                 <!--
                 <li>
                     <asp:LinkButton ID="btnEdit" runat="server">
                         <i class="icon icon-edit"></i>&nbsp;Edit
                     </asp:LinkButton>
                 </li>
                 -->
                 <li>
                     <asp:LinkButton ID="btnAdd" runat="server" OnClick="btnAdd_Click">
                         <i class="icon icon-add"></i>&nbsp;Add New
                     </asp:LinkButton>
                 </li>
            </ul>
            <asp:MultiView ID="mv" runat="server" ActiveViewIndex="0">
                <asp:View ID="v1" runat="server">
                    <h5 class="text-info">View Locations</h5>
                    <asp:Repeater ID="rp1" runat="server" DataSourceID="s1" OnItemCommand="rp1_ItemCommand">
                        <HeaderTemplate>
                            <table class="table table-condensed table-striped table-hover">
                                <tr>
                                    <th>Location Id</th>
                                    <th>Location Name</th>
                                    <th>Description</th>
                                    <th>Actions</th>
                                </tr>
                            
                        </HeaderTemplate>
                        <ItemTemplate>
                            <tr>
                                <td><%# Eval("locationid") %></td>
                                <td><%# Eval("locationname") %></td>
                                <td><%# Eval("description") %></td>
                                <td>
                                    <asp:LinkButton ID="btnDetail" runat="server"
                                        CommandName="detail" CommandArgument='<%# Eval("locationid") %>'>
                                        Detail</asp:LinkButton>&nbsp;
                                     <asp:LinkButton ID="btnEdit" runat="server" 
                                        CommandName="edit" CommandArgument='<%# Eval("locationid") %>'>
                                        Edit</asp:LinkButton>&nbsp;
                                    <asp:LinkButton ID="btnDelete" runat="server"
                                        CommandName="delete" CommandArgument='<%# Eval("locationid") %>' OnClientClick="return confirm('You want to delete it?');">
                                        Delete
                                    </asp:LinkButton>
                                </td>
                            </tr>

                        </ItemTemplate>
                        <FooterTemplate>
                            </table>
                        </FooterTemplate>
                    </asp:Repeater>
                </asp:View>
                <asp:View ID="v2" runat="server">
                    <h5 class="text-info">Add New Location</h5>
                    <label for="txtLocationName">
                        Location Name
                    </label>
                    <asp:TextBox ID="txtLocationName" runat="server" Width="360"></asp:TextBox>
                    <label for="txtDescription">Description</label>
                    <asp:TextBox ID="txtDescription" TextMode="MultiLine" runat="server" Width="360" Height="60"></asp:TextBox>
                    <br />
                    <asp:LinkButton ID="btnSave" runat="server" CssClass="btn btn-primary btn-small" OnClick="btnSave_Click">
                       <i class="icon-ok-circle icon-white"></i> Save</asp:LinkButton>
                    <asp:LinkButton ID="btnCancel" runat="server" CssClass="btn btn-danger btn-small" OnClick="btnCancel_Click">
                        <i class="icon-remove-sign icon-white"></i> Cancel</asp:LinkButton>
                    <asp:LinkButton ID="btnClose" runat="server" CssClass="btn btn-success btn-small" OnClick="btnClose_Click">
                        <i class="icon-arrow-left icon-white"></i> Back</asp:LinkButton>
                    <br /><br />
                     <div runat="server" id="actionSms"></div>
                </asp:View>
                <asp:View ID="vDetail" runat="server">
                    <h5 class="text-info">View Detail Location</h5>
                  <table class="tbl">
                      <tr>
                          <th>Location Id</th>
                          <td style="width: 40px;">&nbsp;:</td>
                          <td><asp:Label ID="lb1" runat="server" CssClass="text-info"></asp:Label></td>
                      </tr>
                      <tr>
                          <th>Location Name</th>
                          <td>&nbsp;:</td>
                          <td><asp:Label ID="lb2" runat="server" CssClass="text-info"></asp:Label></td>
                      </tr>
                      <tr>
                          <th>Description</th>
                          <td>&nbsp;:</td>
                          <td><asp:Label ID="lb3" runat="server" CssClass="text-info"></asp:Label></td>
                      </tr>
                      <tr>
                          <th>Is Deleted</th>
                          <td>&nbsp;:</td>
                          <td><asp:Label ID="lb4" runat="server" CssClass="text-info"></asp:Label></td>
                      </tr>
                      <tr>
                          <td></td>
                          <td></td>
                          <td></td>
                      </tr>
                      <tr>
                          <td>
                              <asp:LinkButton ID="btnBack" runat="server" CssClass="btn btn-success btn-small" OnClick="btnBack_Click">
                                  <i class="icon-arrow-left icon-white"></i> Back</asp:LinkButton>
                          </td>
                          <td></td>
                          <td></td>
                      </tr>
                  </table>
                </asp:View>
                <asp:View ID="vEdit" runat="server">
                    <h5 class="text-info">Update Location</h5>
                    <asp:HiddenField ID="txt3" runat="server" />
                    <label for="txt1">
                        Location Name
                    </label>
                    <asp:TextBox ID="txt1" runat="server" Width="360"></asp:TextBox>
                    <label for="txt2">
                        Description
                    </label>
                    <asp:TextBox ID="txt2" runat="server" Width="360" TextMode="MultiLine" Height="60">

                    </asp:TextBox>
                    <br />
                    <asp:LinkButton ID="btnUpdate" runat="server" CssClass="btn btn-primary btn-small" OnClick="btnUpdate_Click" OnClientClick="return confirm('You want to update?')">
                        <i class="icon-ok-circle icon-white"></i> Update</asp:LinkButton>
                    <asp:LinkButton ID="btnCancelUpdate" runat="server" CssClass="btn btn-danger btn-small" OnClick="btnCancelUpdate_Click">
                        <i class="icon-remove-sign icon-white"></i> Cancel</asp:LinkButton>
                    <br />
                    <div id="updateSms" runat="server"></div>
                  <%--  update modal--%>

                   <%-- <div class="overlay">

                    </div>
                    <div class="modal-wraper">
                            <div id="header" class="header">
                                <h4 class="mtitle">Confirmation</h4>
                            </div>
                            <div class="mcontent">
                                Are you sure you want to update?
                            </div>
                            <div class="mbutton">
                                <asp:Button ID="ok" runat="server" Text=" Yes " CssClass="btn btn-primary btn-small" />&nbsp;&nbsp;
                                <asp:Button ID="cancel" runat="server" Text=" No " CssClass="btn btn-danger btn-small" />
                            </div>
                    </div>--%>
                </asp:View>
            </asp:MultiView>

        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
